From: Derk-Jan Hartman Date: Sun, 10 May 2015 14:30:14 +0000 (+0200) Subject: LivePreview: Process jsconfigvars X-Git-Tag: 1.31.0-rc.0~11453 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=23f56a62ea76890325a2bfa85859372c884780a2;p=lhc%2Fweb%2Fwiklou.git LivePreview: Process jsconfigvars Any jsconfigvars added by the new previewed content needs to added to the context, so that it can be used by the modules. Bug: T92944 Change-Id: Ib990f00ebe974008cea4dccbaa212ec20c846674 --- diff --git a/resources/src/mediawiki.action/mediawiki.action.edit.preview.js b/resources/src/mediawiki.action/mediawiki.action.edit.preview.js index f24703af29..5074d942b7 100644 --- a/resources/src/mediawiki.action/mediawiki.action.edit.preview.js +++ b/resources/src/mediawiki.action/mediawiki.action.edit.preview.js @@ -121,12 +121,15 @@ $.extend( postData, { pst: '', preview: '', - prop: 'text|displaytitle|modules|categorieshtml|templates|langlinks|limitreporthtml', + prop: 'text|displaytitle|modules|jsconfigvars|categorieshtml|templates|langlinks|limitreporthtml', disableeditsection: true } ); request = api.post( postData ); request.done( function ( response ) { var li, newList, $displaytitle, $content, $parent, $list; + if ( response.parse.jsconfigvars ) { + mw.config.set( response.parse.jsconfigvars ); + } if ( response.parse.modules ) { mw.loader.load( response.parse.modules.concat( response.parse.modulescripts,